home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************
- #
- # App.h
- #
- # This file contains the constants and structure definitions.
- #
- # Author(s): Michael Marinkovich
- # Apple Developer Technical Support
- # marink@apple.com
- #
- # Modification History:
- #
- # 4/3/96 MWM Initial coding
- #
- # Copyright © 1992-96 Apple Computer, Inc., All Rights Reserved
- #
- #
- # You may incorporate this sample code into your applications without
- # restriction, though the sample code has been provided "AS IS" and the
- # responsibility for its operation is 100% yours. However, what you are
- # not permitted to do is to redistribute the source as "DSC Sample Code"
- # after having made changes. If you're going to re-distribute the source,
- # we require that you make it clear in the source that the code was
- # descended from Apple Sample Code, but that you've made changes.
- #
- *************************************************************************************/
-
- #include <QDOffscreen.h>
-
-
- //---------------------------------------------------------------------
- //
- // Macros
- //
- //---------------------------------------------------------------------
-
- #define MIN(x,y) ( ((x)<(y)) ? (x) : (y) )
- #define MAX(x,y) ( ((x)>(y)) ? (x) : (y) )
- #define TopLeft( r ) ( *(Point *) &(r).top )
- #define BotRight( r ) ( *(Point *) &(r).bottom )
-
-
- //---------------------------------------------------------------------
- //
- // General
- //
- //---------------------------------------------------------------------
-
- #define kMinHeap 300 * 1024
- #define kMinSpace 300 * 1024
-
-
- //---------------------------------------------------------------------
- //
- // Menus
- //
- //---------------------------------------------------------------------
-
- #define rMBarID 128
-
- enum {
- mApple = 128,
- iAbout = 1,
-
- mFile = 129,
- iNew = 1,
- iOpen = 2,
- iClose = 3,
- iSave = 4,
- iQuit = 6
- };
-
-
- //---------------------------------------------------------------------
- //
- // Custom Get/Put file
- //
- //---------------------------------------------------------------------
-
-
- // file types
- enum {
- kSignature = 'PW91',
- kAllType = '????',
- kPICTType = 'PICT',
- kJPEGType = 'JPEG'
- };
-
- enum {
- kAllGetID = 1,
- kPICTGetID = 2,
- kJPEGGetID = 3,
- kPICTPutID = 1,
- kJPEGPutID = 2
- };
-
- #define kHeaderSize 512
-
- #define rCustomGetPopupID 10
- #define rCustomPutPopupID 11
-
-
- //---------------------------------------------------------------------
- //
- // Scanner Setup dialog
- //
- //---------------------------------------------------------------------
-
- enum {
- kSourcePopup = 3, // source popup
- kSourceFlatbedItem = 1,
- kSourceADFItem = 2,
- kSourceTPUItem = 3,
-
- kColorPopup = 4, // color popup
- kColorFull = 1,
- kColorGrayScale = 2,
-
- kResolutionPopup = 5, // resolution popup
-
- kHeightItem = 6, // height edit text
- kWidthItem = 7, // width edit text
-
- kHalfTonePopup = 3, // halftone popup
-
- kTPUPositive = 3,
- kTPUNegative = 4,
- kTPUFilmPopup = 6
- };
-
-
- //---------------------------------------------------------------------
- //
- // Scanner App specific errors
- //
- //---------------------------------------------------------------------
-
- #define kADFCoverOpenErr -17073
- #define kADFPaperJamErr -17074
- #define kADFNoPaperErr -17075
-
-
- //---------------------------------------------------------------------
- //
- // Window stuff
- //
- //---------------------------------------------------------------------
-
- // doc types
- enum {
- kDocKind = 94,
- kDialogKind = 95,
- kFloatKind = 96,
- kAboutKind = 97
- };
-
-
- #define kFudgeFactor 4 // fudge factor for boundary around window
- #define kTitleBarHeight 18 // title bar height
-
- // scroll additions
- #define kScrollWidth 15
- #define kScrollDelta 16
-
-
- //---------------------------------------------------------------------
- //
- // General resource ID's
- //
- //---------------------------------------------------------------------
-
- #define rToolWind 129
-
- #define rAboutPictID 3000 // about picture
-
- // dialog ID's
- enum {
- rErrorDlg = 128,
- rNewScanDlg = 129,
- rHalfToneDlg = 130,
- rTransparentDlg = 131,
- rCustomGetDlg = 132,
- rCustomPutDlg = 133
- };
-
-
- //---------------------------------------------------------------------
- //
- // Alert Error ID's
- //
- //---------------------------------------------------------------------
-
- #define kNeedsDisplayManager 128 // ID of no Display Manager
-
-
- //---------------------------------------------------------------------
- //
- // Custom Event Proc stuff
- //
- //---------------------------------------------------------------------
-
- enum {
- kIdleProc = 1,
- kMenuProc = 2,
- kInContentProc = 3,
- kInGoAwayProc = 4,
- kInZoomProc = 5,
- kInGrowProc = 6,
- kMUpProc = 7,
- kKeyProc = 8,
- kActivateProc = 9,
- kUpdateProc = 10
- };
-
-
- //---------------------------------------------------------------------
- //
- // Typedefs
- //
- //---------------------------------------------------------------------
-
- // event handling proc
- typedef void (*CustomProc)(WindowRef window, void *refCon);
-
-
- // we just use the basic events for the callback procs
-
- struct DocRec
- {
- CustomProc idleProc; // custom idle proc
- CustomProc mMenuProc; // custom menu proc
- CustomProc inContentProc; // custom content click Proc
- CustomProc inGoAwayProc; // custom inGoAway proc
- CustomProc inZoomProc; // custom inZoom proc
- CustomProc inGrowProc; // custom inGrow proc
- CustomProc mUpProc; // custom mouseUp proc
- CustomProc keyProc; // custom autoKey-keyDown proc
- CustomProc activateProc; // custom activate window proc
- CustomProc updateProc; // custom window update proc
- ControlRef hScroll; // horz scroll bar
- ControlRef vScroll; // vert scroll bar
- GWorldPtr world; // offscreen for pict imaging
- PicHandle pict; // windows picture
- OSType fileType; // the docs fileType
- THPrint printer; // apps print record - inited at window int
- Boolean dirty; // document needs saving
- };
-
- typedef struct DocRec DocRec;
- typedef DocRec *DocPtr, **DocHnd;
-
-
- struct UserSettings
- {
- short inputMethod;
- Fixed height;
- Fixed width;
- short compMode;
- Fixed resolution;
- short pixelDepth;
- short brightness;
- short contrast;
- short ditherPattern;
- short TPUFilm;
- short TPULight;
- short TPUVendor;
- };
-
- typedef struct UserSettings UserSettings;
- typedef UserSettings *UserSettingsPtr, **UserSettingsHnd;
-
-
-
-
-
-
-
-
-
-
-
-
-
-